-meta_kind = params[:meta_kind] || f.object.meta_kind
-kinds = Directive.kinds_for(meta_kind)

-content_for :modal_title do
  -if f.object.new_record?
    Create New #{meta_kind.to_s.titleize}
  -else
    Edit #{meta_kind.to_s.titleize}

-if !f.object.new_record?
  -content_for :modal_delete_path, delete_flow_directive_path(f.object)

.row-fluid
  =wrapped_text_field f, :span6, :title, :placeholder => 'Enter title', :label_name => 'Title <span class="required">*</span>'.html_safe
  .span6
    .row-fluid
      =wrapped_text_field f, :span6, :slug, :label_name => 'Code (autofill)', :placeholder => "#{f.object.default_slug_prefix}-XXXX"
      -#=wrapped_text_field f, :span6, :version, :placeholder => '1.1.1'
      -if kinds.size > 0
        =wrapped_select f, :span6, :kind, kinds, :selected => f.object.kind
      -else
        =f.hidden_field(:kind, kinds[0])

.row-fluid
  =wrapped_text_area f, :span6, :description, :class => 'double wysihtml5', :wrapper_div_class => 'wysiwyg-area', :placeholder => 'Enter description here'
  .span6
    .row-fluid
      =wrapped_date_field f, :span6, :start_date, :class => 'date', :label_name => 'Effective Date', :placeholder => 'MM/DD/YYYY'
      =wrapped_date_field f, :span6, :stop_date, :class => 'date', :label_name => 'Stop Date', :placeholder => 'MM/DD/YYYY'

.row-fluid
  =wrapped_text_field f, :span3, :organization, :placeholder => "Organization for this #{meta_kind}"
  =wrapped_text_field f, :span3, :url, :label_name => 'Direct Link', :placeholder => 'http://www.example.com/'
%br

.row-fluid
  .span6.scope{ :class => error_class(f, :scope) }
    %label.subtitle{ :for => "directive-scope" }
      Scope/Applicability of this #{meta_kind.to_s.titleize}
    .row-fluid
      .wysiwyg-area
        %textarea#directive-scope.span12.double.wysihtml5{:name => 'directive[scope]', :placeholder => "One-sentence explanation of the applicability of this #{meta_kind}, used in mail merge templates.", :rows => "3", }=f.object.scope
      =error_messages_inline(f, :scope)

=render :partial => "shared/wysihtml5"
